<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>好友详情 - 社交圈</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #818cf8;
            --secondary: #ec4899;
            --success: #10b981;
            --danger: #ef4444;
            --dark: #1e293b;
            --light: #f8fafc;
            --gray: #94a3b8;
            --border: #e2e8f0;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: #f5f7fa;
            color: var(--dark);
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            border-bottom: 1px solid var(--border);
            z-index: 1000;
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--dark);
            background: transparent;
            border: none;
        }
        
        .nav-btn:hover {
            background-color: var(--light);
        }
        
        /* 个人资料头部 */
        .profile-header {
            margin-top: 56px;
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: white;
            padding: 30px 16px 60px;
            position: relative;
        }
        
        .profile-cover {
            width: 100%;
            height: 140px;
            object-fit: cover;
            border-radius: 12px 12px 0 0;
        }
        
        .avatar-container {
            position: absolute;
            bottom: -50px;
            left: 16px;
        }
        
        .profile-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            object-fit: cover;
            border: 4px solid white;
            box-shadow: var(--shadow);
        }
        
        .profile-verified {
            position: absolute;
            bottom: 5px;
            right: 5px;
            background-color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
        }
        
        /* 个人资料信息 */
        .profile-info {
            padding: 60px 16px 16px;
            background-color: white;
            border-radius: 16px 16px 0 0;
            margin-top: -16px;
        }
        
        .profile-name {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 4px;
        }
        
        .profile-meta {
            color: var(--gray);
            font-size: 0.9rem;
            margin-bottom: 12px;
        }
        
        .profile-bio {
            font-size: 0.95rem;
            line-height: 1.5;
            margin-bottom: 16px;
        }
        
        .profile-stats {
            display: flex;
            justify-content: space-around;
            text-align: center;
            padding: 12px 0;
            border-top: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
            margin-bottom: 16px;
        }
        
        .stat-value {
            font-weight: 700;
            font-size: 1.1rem;
            color: var(--primary);
        }
        
        .stat-label {
            font-size: 0.8rem;
            color: var(--gray);
        }
        
        /* 操作按钮组 */
        .action-buttons {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        
        .btn-primary {
            background-color: var(--primary);
            border-color: var(--primary);
        }
        
        .btn-primary:hover {
            background-color: var(--primary-light);
            border-color: var(--primary-light);
        }
        
        .btn-outline-primary {
            color: var(--primary);
            border-color: var(--primary);
        }
        
        .btn-outline-primary:hover {
            background-color: var(--primary);
            color: white;
        }
        
        /* 标签样式 */
        .tags-container {
            margin-bottom: 20px;
        }
        
        .tags-title {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 8px;
        }
        
        .tag {
            display: inline-block;
            padding: 4px 12px;
            background-color: rgba(79, 70, 229, 0.1);
            color: var(--primary);
            border-radius: 20px;
            font-size: 0.8rem;
            margin-right: 8px;
            margin-bottom: 8px;
        }
        
        /* 内容选项卡 */
        .profile-tabs {
            display: flex;
            background-color: white;
            border-bottom: 1px solid var(--border);
        }
        
        .tab-item {
            flex: 1;
            text-align: center;
            padding: 12px 0;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--gray);
            position: relative;
        }
        
        .tab-item.active {
            color: var(--primary);
        }
        
        .tab-item.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 3px;
            background-color: var(--primary);
        }
        
        /* 动态内容区 */
        .tab-content {
            padding: 16px;
            background-color: white;
        }
        
        .content-section {
            display: none;
        }
        
        .content-section.active {
            display: block;
        }
        
        /* 动态卡片 */
        .post-card {
            border-radius: 12px;
            background-color: white;
            box-shadow: var(--shadow);
            margin-bottom: 16px;
            overflow: hidden;
        }
        
        .post-header {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .post-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .post-author {
            font-weight: 600;
            font-size: 0.9rem;
        }
        
        .post-time {
            font-size: 0.75rem;
            color: var(--gray);
        }
        
        .post-content {
            padding: 0 16px 12px;
            font-size: 0.95rem;
            line-height: 1.5;
        }
        
        .post-media {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 2px;
            margin-bottom: 12px;
        }
        
        .post-img {
            width: 100%;
            aspect-ratio: 1/1;
            object-fit: cover;
        }
        
        .post-actions {
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            border-top: 1px solid var(--border);
        }
        
        .post-action {
            display: flex;
            align-items: center;
            gap: 4px;
            color: var(--gray);
            font-size: 0.85rem;
            background: none;
            border: none;
        }
        
        .post-action.liked {
            color: var(--danger);
        }
        
        /* 留言区 */
        .comments-section {
            margin-top: 16px;
        }
        
        .comments-title {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 16px;
            display: flex;
            justify-content: space-between;
        }
        
        .comment-card {
            display: flex;
            gap: 10px;
            margin-bottom: 16px;
        }
        
        .comment-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }
        
        .comment-content {
            flex: 1;
            background-color: var(--light);
            border-radius: 16px;
            padding: 10px 12px;
        }
        
        .comment-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 4px;
        }
        
        .comment-author {
            font-weight: 600;
            font-size: 0.85rem;
        }
        
        .comment-time {
            font-size: 0.7rem;
            color: var(--gray);
        }
        
        .comment-text {
            font-size: 0.9rem;
            margin-bottom: 6px;
        }
        
        .comment-actions {
            display: flex;
            gap: 12px;
            font-size: 0.75rem;
        }
        
        .comment-action {
            color: var(--gray);
            background: none;
            border: none;
            padding: 0;
            display: flex;
            align-items: center;
            gap: 2px;
        }
        
        .comment-action.liked {
            color: var(--danger);
        }
        
        /* 回复区 */
        .replies {
            margin-left: 46px;
            margin-top: 8px;
        }
        
        .reply-card {
            display: flex;
            gap: 8px;
            margin-bottom: 8px;
        }
        
        .reply-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }
        
        .reply-content {
            flex: 1;
            background-color: rgba(79, 70, 229, 0.05);
            border-radius: 14px;
            padding: 8px 10px;
        }
        
        /* 留言输入框 */
        .comment-input-container {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: white;
            padding: 10px 16px;
            border-top: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 900;
        }
        
        .comment-input {
            flex: 1;
            border: 1px solid var(--border);
            border-radius: 20px;
            padding: 8px 16px;
            font-size: 0.9rem;
            outline: none;
        }
        
        .comment-input:focus {
            border-color: var(--primary);
        }
        
        .send-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 关系图样式 */
        .relationship-graph {
            background-color: var(--light);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 20px;
        }
        
        .graph-title {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 16px;
        }
        
        .graph-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }
        
        .central-node {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            z-index: 2;
        }
        
        .node-level {
            display: flex;
            gap: 12px;
            position: relative;
        }
        
        .node-level::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 2px;
            background-color: var(--border);
            z-index: 1;
        }
        
        .relationship-node {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: white;
            border: 2px solid var(--primary-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--primary);
            z-index: 2;
            position: relative;
        }
        
        .node-label {
            position: absolute;
            bottom: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.7rem;
            color: var(--gray);
            white-space: nowrap;
        }
        
        /* 共同好友 */
        .common-friends {
            margin-bottom: 20px;
        }
        
        .friends-list {
            display: flex;
            gap: 16px;
            overflow-x: auto;
            padding-bottom: 8px;
        }
        
        .friend-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex-shrink: 0;
            width: 70px;
        }
        
        .friend-avatar {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            object-fit: cover;
            margin-bottom: 6px;
        }
        
        .friend-name {
            font-size: 0.85rem;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 100%;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 0.9rem;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">好友详情</div>
        <button class="nav-btn" id="moreBtn">
            <i class="fas fa-ellipsis-v"></i>
        </button>
    </div>
    
    <!-- 个人资料头部 -->
    <div class="profile-header">
        <div class="avatar-container">
            <img src="https://picsum.photos/id/64/200/200" alt="陈艺的头像" class="profile-avatar">
            <div class="profile-verified">
                <i class="fas fa-check"></i>
            </div>
        </div>
    </div>
    
    <!-- 个人资料信息 -->
    <div class="profile-info">
        <h1 class="profile-name">陈艺</h1>
        <div class="profile-meta">
            <span>摄影爱好者 • 28岁</span>
            <span class="mx-2">•</span>
            <span>2.3公里</span>
        </div>
        
        <p class="profile-bio">
            自由摄影师，擅长人文和风光摄影，期待认识更多摄影爱好者一起交流创作。曾获全国青年摄影大赛金奖。
        </p>
        
        <div class="action-buttons">
            <button class="btn btn-primary flex-1" id="chatBtn">
                <i class="fas fa-comment me-1"></i> 聊天
            </button>
            <button class="btn btn-outline-primary flex-1" id="callBtn">
                <i class="fas fa-phone me-1"></i> 通话
            </button>
            <button class="btn btn-outline-primary" id="moreActionBtn">
                <i class="fas fa-ellipsis-h"></i>
            </button>
        </div>
        
        <div class="profile-stats">
            <div class="stat-item">
                <div class="stat-value">328</div>
                <div class="stat-label">动态</div>
            </div>
            <div class="stat-item">
                <div class="stat-value">1,254</div>
                <div class="stat-label">粉丝</div>
            </div>
            <div class="stat-item">
                <div class="stat-value">536</div>
                <div class="stat-label">关注</div>
            </div>
            <div class="stat-item">
                <div class="stat-value">26</div>
                <div class="stat-label">共同好友</div>
            </div>
        </div>
        
        <div class="tags-container">
            <div class="tags-title">兴趣爱好</div>
            <div class="tags">
                <span class="tag">摄影</span>
                <span class="tag">旅行</span>
                <span class="tag">户外</span>
                <span class="tag">电影</span>
                <span class="tag">音乐</span>
                <span class="tag">咖啡</span>
            </div>
        </div>
        
        <!-- 关系图 -->
        <div class="relationship-graph">
            <div class="graph-title">人际关系</div>
            <div class="graph-container">
                <div class="node-level">
                    <div class="relationship-node">
                        李
                        <div class="node-label">同学</div>
                    </div>
                    <div class="relationship-node">
                        王
                        <div class="node-label">同事</div>
                    </div>
                    <div class="relationship-node">
                        张
                        <div class="node-label">好友</div>
                    </div>
                </div>
                <div class="central-node">你</div>
                <div class="node-level">
                    <div class="relationship-node">
                        陈
                        <div class="node-label">当前好友</div>
                    </div>
                </div>
                <div class="node-level">
                    <div class="relationship-node">
                        刘
                        <div class="node-label">陈艺的好友</div>
                    </div>
                    <div class="relationship-node">
                        赵
                        <div class="node-label">陈艺的好友</div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 共同好友 -->
        <div class="common-friends">
            <div class="tags-title">共同好友 (26)</div>
            <div class="friends-list">
                <div class="friend-item">
                    <img src="https://picsum.photos/id/91/100/100" alt="张健" class="friend-avatar">
                    <span class="friend-name">张健</span>
                </div>
                <div class="friend-item">
                    <img src="https://picsum.photos/id/237/100/100" alt="刘文静" class="friend-avatar">
                    <span class="friend-name">刘文静</span>
                </div>
                <div class="friend-item">
                    <img src="https://picsum.photos/id/342/100/100" alt="马超" class="friend-avatar">
                    <span class="friend-name">马超</span>
                </div>
                <div class="friend-item">
                    <img src="https://picsum.photos/id/399/100/100" alt="赵敏" class="friend-avatar">
                    <span class="friend-name">赵敏</span>
                </div>
                <div class="friend-item">
                    <img src="https://picsum.photos/id/453/100/100" alt="李娜" class="friend-avatar">
                    <span class="friend-name">李娜</span>
                </div>
                <div class="friend-item">
                    <img src="https://picsum.photos/id/542/100/100" alt="王浩" class="friend-avatar">
                    <span class="friend-name">王浩</span>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 内容选项卡 -->
    <div class="profile-tabs">
        <div class="tab-item active" data-tab="posts">动态</div>
        <div class="tab-item" data-tab="photos">照片</div>
        <div class="tab-item" data-tab="comments">留言</div>
    </div>
    
    <!-- 动态内容区 -->
    <div class="tab-content">
        <!-- 动态内容 -->
        <div class="content-section active" id="posts">
            <!-- 动态1 -->
            <div class="post-card">
                <div class="post-header">
                    <img src="https://picsum.photos/id/64/100/100" alt="陈艺" class="post-avatar">
                    <div>
                        <div class="post-author">陈艺</div>
                        <div class="post-time">昨天 14:32</div>
                    </div>
                </div>
                <div class="post-content">
                    周末在郊外拍摄的风光，光线正好，分享给大家。#风光摄影 #周末出行
                </div>
                <div class="post-media">
                    <img src="https://picsum.photos/id/10/600/600" alt="摄影作品" class="post-img">
                    <img src="https://picsum.photos/id/11/600/600" alt="摄影作品" class="post-img">
                </div>
                <div class="post-actions">
                    <button class="post-action" id="like1">
                        <i class="far fa-heart"></i>
                        <span>128</span>
                    </button>
                    <button class="post-action">
                        <i class="far fa-comment"></i>
                        <span>32</span>
                    </button>
                    <button class="post-action">
                        <i class="far fa-share-square"></i>
                        <span>分享</span>
                    </button>
                </div>
            </div>
            
            <!-- 动态2 -->
            <div class="post-card">
                <div class="post-header">
                    <img src="https://picsum.photos/id/64/100/100" alt="陈艺" class="post-avatar">
                    <div>
                        <div class="post-author">陈艺</div>
                        <div class="post-time">3天前</div>
                    </div>
                </div>
                <div class="post-content">
                    新入手的相机，迫不及待试拍了几张，感觉画质提升明显，推荐给各位摄影爱好者。
                </div>
                <div class="post-media">
                    <img src="https://picsum.photos/id/3/600/600" alt="相机照片" class="post-img" style="grid-column: span 2;">
                </div>
                <div class="post-actions">
                    <button class="post-action" id="like2">
                        <i class="far fa-heart"></i>
                        <span>256</span>
                    </button>
                    <button class="post-action">
                        <i class="far fa-comment"></i>
                        <span>64</span>
                    </button>
                    <button class="post-action">
                        <i class="far fa-share-square"></i>
                        <span>分享</span>
                    </button>
                </div>
            </div>
        </div>
        
        <!-- 照片内容 -->
        <div class="content-section" id="photos">
            <div class="row g-1">
                <div class="col-4">
                    <img src="https://picsum.photos/id/64/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <img src="https://picsum.photos/id/65/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <img src="https://picsum.photos/id/66/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <img src="https://picsum.photos/id/67/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <img src="https://picsum.photos/id/68/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <img src="https://picsum.photos/id/69/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <img src="https://picsum.photos/id/70/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <img src="https://picsum.photos/id/71/300/300" alt="照片" class="w-100 rounded" style="aspect-ratio: 1/1; object-fit: cover;">
                </div>
                <div class="col-4">
                    <div class="w-100 h-100 rounded bg-light d-flex align-items-center justify-content-center text-primary">
                        <span class="fw-bold">+24</span>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 留言内容 -->
        <div class="content-section" id="comments">
            <div class="comments-section">
                <div class="comments-title">
                    <span>留言 (48)</span>
                    <span class="text-primary" style="font-size: 0.9rem;">查看全部</span>
                </div>
                
                <!-- 留言1 -->
                <div class="comment-card">
                    <img src="https://picsum.photos/id/91/100/100" alt="张健" class="comment-avatar">
                    <div class="comment-content">
                        <div class="comment-header">
                            <span class="comment-author">张健</span>
                            <span class="comment-time">昨天 09:45</span>
                        </div>
                        <div class="comment-text">
                            你的摄影作品太棒了，尤其是那组城市夜景，构图很专业！
                        </div>
                        <div class="comment-actions">
                            <button class="comment-action" id="commentLike1">
                                <i class="far fa-heart"></i>
                                <span>18</span>
                            </button>
                            <button class="comment-action replyBtn">回复</button>
                        </div>
                        
                        <!-- 回复 -->
                        <div class="replies">
                            <div class="reply-card">
                                <img src="https://picsum.photos/id/64/100/100" alt="陈艺" class="reply-avatar">
                                <div class="reply-content">
                                    <div class="comment-header">
                                        <span class="comment-author">陈艺</span>
                                        <span class="comment-time">昨天 10:12</span>
                                    </div>
                                    <div class="comment-text">
                                        谢谢夸奖，有空可以一起交流摄影技巧~
                                    </div>
                                    <div class="comment-actions">
                                        <button class="comment-action" id="replyLike1">
                                            <i class="far fa-heart"></i>
                                            <span>5</span>
                                        </button>
                                        <button class="comment-action replyBtn">回复</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 留言2 -->
                <div class="comment-card">
                    <img src="https://picsum.photos/id/237/100/100" alt="刘文静" class="comment-avatar">
                    <div class="comment-content">
                        <div class="comment-header">
                            <span class="comment-author">刘文静</span>
                            <span class="comment-time">3天前</span>
                        </div>
                        <div class="comment-text">
                            上次你推荐的那本摄影书我已经买了，确实很有启发，谢谢！
                        </div>
                        <div class="comment-actions">
                            <button class="comment-action" id="commentLike2">
                                <i class="far fa-heart"></i>
                                <span>12</span>
                            </button>
                            <button class="comment-action replyBtn">回复</button>
                        </div>
                    </div>
                </div>
                
                <!-- 留言3 -->
                <div class="comment-card">
                    <img src="https://picsum.photos/id/342/100/100" alt="马超" class="comment-avatar">
                    <div class="comment-content">
                        <div class="comment-header">
                            <span class="comment-author">马超</span>
                            <span class="comment-time">1周前</span>
                        </div>
                        <div class="comment-text">
                            下周有个摄影展，一起去看吗？听说有很多大师作品。
                        </div>
                        <div class="comment-actions">
                            <button class="comment-action" id="commentLike3">
                                <i class="far fa-heart"></i>
                                <span>8</span>
                            </button>
                            <button class="comment-action replyBtn">回复</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 留言输入框 -->
    <div class="comment-input-container">
        <input type="text" class="comment-input" placeholder="写下你的留言...">
        <button class="send-btn" id="sendComment">
            <i class="fas fa-paper-plane"></i>
        </button>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toastMessage"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const moreBtn = document.getElementById('moreBtn');
        const chatBtn = document.getElementById('chatBtn');
        const callBtn = document.getElementById('callBtn');
        const moreActionBtn = document.getElementById('moreActionBtn');
        const tabItems = document.querySelectorAll('.tab-item');
        const contentSections = document.querySelectorAll('.content-section');
        const likeButtons = [document.getElementById('like1'), document.getElementById('like2')];
        const commentLikeButtons = [
            document.getElementById('commentLike1'),
            document.getElementById('commentLike2'),
            document.getElementById('commentLike3'),
            document.getElementById('replyLike1')
        ];
        const replyButtons = document.querySelectorAll('.replyBtn');
        const sendCommentBtn = document.getElementById('sendComment');
        const commentInput = document.querySelector('.comment-input');
        const toastMessage = document.getElementById('toastMessage');
        
        // 初始化
        function init() {
            setupEventListeners();
        }
        
        // 设置事件监听
        function setupEventListeners() {
            // 返回按钮
            backBtn.addEventListener('click', () => {
                showToast('返回好友列表');
            });
            
            // 更多按钮
            moreBtn.addEventListener('click', () => {
                showToast('显示更多选项');
            });
            
            // 聊天按钮
            chatBtn.addEventListener('click', () => {
                showToast('进入与陈艺的聊天');
            });
            
            // 通话按钮
            callBtn.addEventListener('click', () => {
                showToast('正在拨打陈艺的电话');
            });
            
            // 更多操作按钮
            moreActionBtn.addEventListener('click', () => {
                showToast('显示更多操作');
            });
            
            // 选项卡切换
            tabItems.forEach(item => {
                item.addEventListener('click', () => {
                    const tabId = item.getAttribute('data-tab');
                    
                    // 更新选项卡状态
                    tabItems.forEach(i => i.classList.remove('active'));
                    item.classList.add('active');
                    
                    // 更新内容区域
                    contentSections.forEach(section => {
                        section.classList.remove('active');
                    });
                    document.getElementById(tabId).classList.add('active');
                    
                    showToast(`切换到${item.textContent}视图`);
                });
            });
            
            // 动态点赞功能
            likeButtons.forEach(btn => {
                btn.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const countEl = this.querySelector('span');
                    let count = parseInt(countEl.textContent);
                    
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        this.classList.add('liked');
                        countEl.textContent = count + 1;
                        showToast('点赞成功');
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        this.classList.remove('liked');
                        countEl.textContent = count - 1;
                        showToast('取消点赞');
                    }
                });
            });
            
            // 留言点赞功能
            commentLikeButtons.forEach(btn => {
                btn.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const countEl = this.querySelector('span');
                    let count = parseInt(countEl.textContent);
                    
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        this.classList.add('liked');
                        countEl.textContent = count + 1;
                        showToast('点赞成功');
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        this.classList.remove('liked');
                        countEl.textContent = count - 1;
                        showToast('取消点赞');
                    }
                });
            });
            
            // 回复按钮
            replyButtons.forEach(btn => {
                btn.addEventListener('click', function() {
                    const author = this.closest('.comment-content, .reply-content').querySelector('.comment-author').textContent;
                    commentInput.value = `回复 @${author}: `;
                    commentInput.focus();
                });
            });
            
            // 发送留言
            sendCommentBtn.addEventListener('click', sendComment);
            
            // 回车发送留言
            commentInput.addEventListener('keypress', function(e) {
                if (e.key === 'Enter') {
                    sendComment();
                }
            });
        }
        
        // 发送留言
        function sendComment() {
            const commentText = commentInput.value.trim();
            if (commentText) {
                showToast('留言发送成功');
                commentInput.value = '';
                
                // 在实际应用中，这里会将留言发送到服务器
                // 并更新留言列表UI
            } else {
                showToast('请输入留言内容');
            }
        }
        
        // 显示提示消息
        function showToast(message) {
            toastMessage.textContent = message;
            toastMessage.classList.add('show');
            setTimeout(() => {
                toastMessage.classList.remove('show');
            }, 2000);
        }
        
        // 初始化页面
        document.addEventListener('DOMContentLoaded', init);
    </script>
</body>
</html>
